package cn.iocoder.yudao.module.system.controller.app.passengerinfo.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Schema(description = "APP - 乘客综合信息 Response VO")
@Data
public class PassengerComprehensiveVO {

    // ========== 乘客基本信息 ==========
    @Schema(description = "乘客信息")
    private PassengerInfo passengerInfo;

    // ========== 用户基本信息 ==========
    @Schema(description = "用户信息")
    private UserInfo userInfo;

    // ========== 订单统计信息 ==========
    @Schema(description = "订单统计信息")
    private OrderStats orderStats;

    // ========== 会员信息 ==========
    @Schema(description = "会员信息")
    private MemberInfo memberInfo;

    // ========== 地址信息 ==========
    @Schema(description = "常用地址信息")
    private AddressInfo addressInfo;

    // ========== 内嵌类定义 ==========
    @Schema(description = "乘客基本信息")
    @Data
    public static class PassengerInfo {
        @Schema(description = "乘客ID")
        private Integer passengerInfoId;
        
        @Schema(description = "用户ID")
        private Long userId;
        
        @Schema(description = "姓名")
        private String name;
        
        @Schema(description = "手机号")
        private String phone;
        
        @Schema(description = "用户级别")
        private String level;
        
        @Schema(description = "成长值")
        private Integer growthValue;
        
        @Schema(description = "总出行公里数")
        private BigDecimal kilometersAll;
        
        @Schema(description = "本月出行里程")
        private BigDecimal kilometersMonth;
        
        @Schema(description = "总充值金额")
        private BigDecimal totalMoney;
        
        @Schema(description = "总订单支付金额")
        private BigDecimal payMoneyAll;
        
        @Schema(description = "本月订单支付金额")
        private BigDecimal payMoneyMonty;
        
        @Schema(description = "可开发票金额")
        private BigDecimal yesInvoice;
        
        @Schema(description = "行程未开票金额")
        private BigDecimal noInvoice;
        
        @Schema(description = "退款金额")
        private BigDecimal refundMoney;
        
        @Schema(description = "总订单数")
        private Integer totalOrders;
    }

    @Schema(description = "用户基本信息")
    @Data
    public static class UserInfo {
        @Schema(description = "用户ID")
        private Long id;
        
        @Schema(description = "用户账号")
        private String username;
        
        @Schema(description = "用户昵称")
        private String nickname;
        
        @Schema(description = "手机号")
        private String mobile;
        
        @Schema(description = "邮箱")
        private String email;
        
        @Schema(description = "性别")
        private Integer sex;
        
        @Schema(description = "头像")
        private String avatar;
        
        @Schema(description = "状态")
        private Integer status;
        
        @Schema(description = "实名认证状态")
        private Integer realNameStatus;
        
        @Schema(description = "实名认证时间")
        private LocalDateTime realNameTime;
        
        @Schema(description = "身份证号")
        private String idCard;
        
        @Schema(description = "账户余额")
        private BigDecimal balance;
        
        @Schema(description = "最后登录时间")
        private LocalDateTime loginDate;
        
        @Schema(description = "注册时间")
        private LocalDateTime createTime;
    }

    @Schema(description = "订单统计信息")
    @Data
    public static class OrderStats {
        @Schema(description = "总订单数")
        private Integer totalCount;
        
        @Schema(description = "已完成订单数")
        private Integer completedCount;
        
        @Schema(description = "已取消订单数")
        private Integer cancelledCount;
        
        @Schema(description = "本月订单数")
        private Integer monthCount;
        
        @Schema(description = "总消费金额")
        private BigDecimal totalAmount;
        
        @Schema(description = "本月消费金额")
        private BigDecimal monthAmount;
        
        @Schema(description = "平均评分")
        private BigDecimal avgRating;
        
        @Schema(description = "总出行里程")
        private BigDecimal totalDistance;
        
        @Schema(description = "本月出行里程")
        private BigDecimal monthDistance;
    }

    @Schema(description = "会员信息")
    @Data
    public static class MemberInfo {
        @Schema(description = "会员等级")
        private Integer level;
        
        @Schema(description = "会员等级名称")
        private String levelName;
        
        @Schema(description = "积分")
        private Integer points;
        
        @Schema(description = "成长值")
        private Integer growthValue;
        
        @Schema(description = "距离下一等级所需成长值")
        private Integer nextLevelGrowth;
        
        @Schema(description = "优惠券数量")
        private Integer couponCount;
    }

    @Schema(description = "地址信息")
    @Data
    public static class AddressInfo {
        @Schema(description = "家庭地址")
        private String homeAddress;
        
        @Schema(description = "公司地址")
        private String workAddress;
        
        @Schema(description = "常用地址列表")
        private java.util.List<CommonAddress> commonAddresses;
    }

    @Schema(description = "常用地址")
    @Data
    public static class CommonAddress {
        @Schema(description = "地址ID")
        private Long id;
        
        @Schema(description = "地址标签")
        private String label;
        
        @Schema(description = "详细地址")
        private String address;
        
        @Schema(description = "经度")
        private BigDecimal longitude;
        
        @Schema(description = "纬度")
        private BigDecimal latitude;
        
        @Schema(description = "使用次数")
        private Integer useCount;
    }
}

